package co.msk8.server.calculator.impl;

import co.msk8.server.calculator.Calculator;

public class IterativeCalculator implements Calculator {

	public int getAddition(int a, int b) {
		
		int result = a;
		while (b > 0) {
			result += 1;
			b--;
		}
		return result;
	}

	public int getSustraction(int a, int b) {
		
		int result = a;
		
		while (b > 0) {
			result -= 1;
			b--;
		}
		return result;
	}

	public int getMultiplication(int a, int b) {
		
		int result = 0;
		while (b > 0) {
			
			result += a;
			b--;
		}
		return result;
	}

	public int getDivision(int a, int b) {
		
		return a / b;
	}

}
